import plotly.offline as pyo
from plotly.graph_objs import *
import chart_studio.plotly as py
import pandas as pd
from pandas import DataFrame
pyo.offline.init_notebook_mode()
trace = [{'type' : 'scatter'}]
layout = {'annotations' : [{'text' : 'Left of the plotting area',
'font' : {'size' : 20},
'xref' : 'paper',
'yref' : 'paper',
'x' : -0.3,
'y' : 0,
'showarrow' : False},
{'text' : 'Right of the plotting area',
'font' : {'size' : 20},
'xref' : 'paper',
'yref' : 'paper',
'x' : 1.3,
'y' : 0,
'showarrow' : False},
{'text' : 'Below the plotting area',
'font' : {'size' : 20},
'xref' : 'paper',
'yref' : 'paper',
'x' : 0,
'y' : -0.5,
'showarrow' : False},
{'text' : 'Above the plotting area',
'font' : {'size' : 20},
'xref' : 'paper',
'yref' : 'paper',
'x' : 1.05,
'y' : 1.6,
'showarrow' : False}]}
fig = Figure(data=trace, layout=layout)
pyo.iplot(fig)
fig['layout'].update({'height' : 600, 'width' : 800})
pyo.iplot(fig)
fig['layout'].update({'margin' : {'b' : 250}})
pyo.iplot(fig)
fig['layout'].update({'margin' : {'t' : 250}})
pyo.iplot(fig)
fig['layout'].update({'margin' : {'l' : 300, 'r' : 300}})
pyo.iplot(fig)